package com.qf.main.pharmacy.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.qf.main.pharmacy.entity.PharmacyClassification;
import com.qf.main.pharmacy.mapper.PharmacyClassificationMapper;
import com.qf.main.pharmacy.service.PharmacyClassificationService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author chengqiang
 * @Create 2024-02-18-21:01
 * @Description:
 */
@Service
public class PharmacyClassificationServiceImpl implements PharmacyClassificationService {
    @Resource
    private PharmacyClassificationMapper pharmacyClassificationMapper;
    @Override
    public List<PharmacyClassification> getPharmacyClassification() {
        return pharmacyClassificationMapper.selectList(new QueryWrapper<>());
    }

    @Override
    public Integer savePharmacyClassification(PharmacyClassification pharmacyClassification) {

        return pharmacyClassificationMapper.insert(pharmacyClassification);
    }

    @Override
    public Integer modifyPharmacyClassification(PharmacyClassification pharmacyClassification) {
        return pharmacyClassificationMapper.updateById(pharmacyClassification);
    }

    @Override
    public Integer removePharmacyClassification(int id) {
        return pharmacyClassificationMapper.deleteById(id);
    }
}
